#!/usr/bin/bash

# $1 - path to archive python sources file
# $2 - mode install (install/altinstall)

source ../programs/install_libs.sh

pushd . > /dev/null

sudo cp $1 /usr/src/
cd /usr/src
sudo tar -xf $(basename $1)

cd Python-*
sudo ./configure &&
    sudo make &&
    sudo make $2 &&
    sudo python3 -m pip install --upgrade setuptool pip

popd . > /dev/null
